class Room < ActiveRecord::Base
  
	has_many :machines
  before_destroy :delete_machines
  
  private
    def delete_machines
        Machine.update_all("room_id = 0", [ "room_id = ?", id ])
    end
 
end
